import React from 'react'; 
import {connect} from "react-redux"; 
import {change,getList2} from "../action";
import L from "fyLocale"; 

var TestView1=React.createClass({
	getInitialState:function(){
		return {a:"hello world"};	
	},
	/*
	组件渲染前
	*/
	componentWillMount:function(){
		//this.setState({a:"i changed before render"});
		//this.props.dispacth();
	},
	clickHandle:function(){
		//this.setState({a:"i changed"});
		this.props.dispatch(change());
		this.props.dispatch(getList2({a:"hello"}));
	},
	render:function () {
		return <div>
			<div onTouchTap={this.clickHandle}> {L.getString("APP_NAME")}  点击1</div>
			<div>{this.props.TestModel1.get("b")}</div>
		</div>;
	}
});

//module.exports=(TestView1);

function mapStateToProps(state){
    var {TestModel1} = state ; 
    return {TestModel1};
} 
module.exports=connect(mapStateToProps)(TestView1);